{% macro render_pagination(pagination, endpoint) %}
<nav aria-label="Page navigation example">
    <ul class="pagination justify-content-center">
    {% if pagination.has_prev %}
        <li class="page-item"><a class="page-link" href="{{ url_for(endpoint, page=pagination.prev_num, _external=True) }}">上一页</a></li>
    {% endif %}
    {% if pagination.has_next %}
      <li class="page-item"><a class="page-link" href="{{ url_for(endpoint, page=pagination.next_num, _external=True) }}">下一页</a></li>
    {% endif %}
    <li class="ml-3 page-item">
        <small class="text-muted">当前第{{pagination.page}}页</small>
    </li>
    </ul>
  </nav>

{% endmacro %}